<?

$srcDbAP  = "ACC_PAYABLE";

/**
* Fetch the amount of 
* Account Payable(A/P) outstanding
*
*/
fetchNetto($COracle,
           $thisJobId,
           $srcDbHdr,
           $payable);

if($isApprove){          

  $status = _OUTSTANDING;

  /**
  * Insert into A/P DB 
  * and set status to _OUTSTANDING,
  * reference would take purchasing's
  *
  */
  insAP($COracle,
        $thisJobId,
        $srcDate,
        $payable,
        $status,
        $srcDbAP);       
}else{
  
  $status = _CANCELED;
  
  /**
  * Update the A/P to Canceled
  *
  */
  updateAP($COracle,
           $thisJobId,
           $status,
           $srcDbAP);
}

?>